home *** CD-ROM | disk | FTP | other *** search
/ PCGUIA 127 / PC Guia 127.iso / Software / Produtividade / OpenOffice.org 2.0.1 / openofficeorg2.cab / ooo2ms_docpr.xsl < prev    next >
Extensible Markup Language  |  2005-09-10  |  8KB  |  146 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3.  
  4.     OpenOffice.org - a multi-platform office productivity suite
  5.  
  6.     $RCSfile: ooo2ms_docpr.xsl,v $
  7.  
  8.     $Revision: 1.9 $
  9.  
  10.     last change: $Author: rt $ $Date: 2005/09/08 22:01:08 $
  11.  
  12.     The Contents of this file are made available subject to
  13.     the terms of GNU Lesser General Public License Version 2.1.
  14.  
  15.  
  16.       GNU Lesser General Public License Version 2.1
  17.       =============================================
  18.       Copyright 2005 by Sun Microsystems, Inc.
  19.       901 San Antonio Road, Palo Alto, CA 94303, USA
  20.  
  21.       This library is free software; you can redistribute it and/or
  22.       modify it under the terms of the GNU Lesser General Public
  23.       License version 2.1, as published by the Free Software Foundation.
  24.  
  25.       This library is distributed in the hope that it will be useful,
  26.       but WITHOUT ANY WARRANTY; without even the implied warranty of
  27.       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  28.       Lesser General Public License for more details.
  29.  
  30.       You should have received a copy of the GNU Lesser General Public
  31.       License along with this library; if not, write to the Free Software
  32.       Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  33.       MA  02111-1307  USA
  34.  
  35. -->
  36. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:w="http://schemas.microsoft.com/office/word/2003/wordml" xmlns:wx="http://schemas.microsoft.com/office/word/2003/auxHint" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:aml="http://schemas.microsoft.com/aml/2001/core" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" exclude-result-prefixes="office table style text draw svg   dc config xlink meta oooc dom ooo chart math dr3d form script ooow draw">
  37.     <xsl:template match="office:meta">
  38.         <o:DocumentProperties>
  39.             <o:Title>
  40.                 <xsl:value-of select="dc:title"/>
  41.             </o:Title>
  42.             <o:Subject>
  43.                 <xsl:value-of select="dc:subject"/>
  44.             </o:Subject>
  45.             <o:Keywords>
  46.                 <xsl:for-each select="meta:keywords/meta:keyword">
  47.                     <xsl:value-of select="."/>
  48.                     <xsl:if test="position()!=last()">, </xsl:if>
  49.                 </xsl:for-each>
  50.             </o:Keywords>
  51.             <o:Description>
  52.                 <xsl:value-of select="dc:description"/>
  53.             </o:Description>
  54.             <o:Category>
  55.                 <xsl:value-of select="meta:user-defined[@meta:name = 'Category']"/>
  56.             </o:Category>
  57.             <o:Author>
  58.                 <xsl:value-of select="meta:initial-creator"/>
  59.             </o:Author>
  60.             <o:LastAuthor>
  61.                 <xsl:value-of select="dc:creator"/>
  62.             </o:LastAuthor>
  63.             <o:Manager>
  64.                 <xsl:value-of select="meta:user-defined[@meta:name = 'Manager']"/>
  65.             </o:Manager>
  66.             <o:Company>
  67.                 <xsl:value-of select="meta:user-defined[@meta:name = 'Company']"/>
  68.             </o:Company>
  69.             <o:HyperlinkBase>
  70.                 <xsl:value-of select="meta:user-defined[@meta:name = 'HyperlinkBase']"/>
  71.             </o:HyperlinkBase>
  72.             <o:Revision>
  73.                 <xsl:value-of select="meta:editing-cycles"/>
  74.             </o:Revision>
  75.             <!-- PresentationFormat, Guid, AppName, Version -->
  76.             <o:TotalTime>
  77.                 <xsl:if test="meta:editing-duration">
  78.                     <xsl:variable name="hours">
  79.                         <xsl:choose>
  80.                             <xsl:when test="contains(meta:editing-duration, 'H')">
  81.                                 <xsl:value-of select="substring-before( substring-after( meta:editing-duration, 'PT'), 'H')"/>
  82.                             </xsl:when>
  83.                             <xsl:otherwise>0</xsl:otherwise>
  84.                         </xsl:choose>
  85.                     </xsl:variable>
  86.                     <xsl:variable name="minutes">
  87.                         <xsl:choose>
  88.                             <xsl:when test="contains(meta:editing-duration, 'M') and contains(meta:editing-duration, 'H')">
  89.                                 <xsl:value-of select="substring-before( substring-after( meta:editing-duration, 'H'), 'M')"/>
  90.                             </xsl:when>
  91.                             <xsl:when test="contains(meta:editing-duration, 'M')">
  92.                                 <xsl:value-of select="substring-before( substring-after( meta:editing-duration, 'PT'), 'M')"/>
  93.                             </xsl:when>
  94.                             <xsl:otherwise>0</xsl:otherwise>
  95.                         </xsl:choose>
  96.                     </xsl:variable>
  97.                     <xsl:value-of select="$hours * 60 + $minutes"/>
  98.                 </xsl:if>
  99.             </o:TotalTime>
  100.             <o:LastPrinted>
  101.                 <xsl:if test="meta:print-date">
  102.                     <xsl:value-of select="concat( meta:print-date, 'Z')"/>
  103.                 </xsl:if>
  104.             </o:LastPrinted>
  105.             <o:Created>
  106.                 <xsl:if test="meta:creation-date">
  107.                     <xsl:value-of select="concat( meta:creation-date, 'Z')"/>
  108.                 </xsl:if>
  109.             </o:Created>
  110.             <o:LastSaved>
  111.                 <xsl:if test="dc:date">
  112.                     <xsl:value-of select="concat( dc:date, 'Z')"/>
  113.                 </xsl:if>
  114.             </o:LastSaved>
  115.             <o:Pages>
  116.                 <xsl:value-of select="meta:document-statistic/@meta:page-count"/>
  117.             </o:Pages>
  118.             <o:Words>
  119.                 <xsl:value-of select="meta:document-statistic/@meta:word-count"/>
  120.             </o:Words>
  121.             <o:Characters>
  122.                 <xsl:value-of select="meta:document-statistic/@meta:character-count"/>
  123.             </o:Characters>
  124.             <!-- CharactersWithSpaces, Bytes, Lines -->
  125.             <o:Paragraphs>
  126.                 <xsl:value-of select="meta:document-statistic/@meta:paragraph-count"/>
  127.             </o:Paragraphs>
  128.         </o:DocumentProperties>
  129.         <o:CustomDocumentProperties>
  130.             <o:Editor dt:dt="string">
  131.                 <xsl:value-of select="meta:generator"/>
  132.             </o:Editor>
  133.             <o:Language dt:dt="string">
  134.                 <xsl:value-of select="dc:language"/>
  135.             </o:Language>
  136.             <xsl:for-each select="meta:user-defined">
  137.                 <!-- transfer strings to XML QName, necessary to convert several characters -->
  138.                 <xsl:element name="{concat( 'o:', translate(@meta:name,'.,| ~`!@#$%^&<>*()+=[]{};:"/\?','_'))}">
  139.                     <xsl:attribute name="dt:dt">string</xsl:attribute>
  140.                     <xsl:value-of select="."/>
  141.                 </xsl:element>
  142.             </xsl:for-each>
  143.         </o:CustomDocumentProperties>
  144.     </xsl:template>
  145. </xsl:stylesheet>
  146.